package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 插入菜品和套餐关系
     *
     * @param setmealDishes
     */
    void insert(List<SetmealDish> setmealDishes);

    void deleteSetmealDishBySetmealIds(List<Long> ids);


    /**
     * 根据套餐id查询
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);

    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteSetmealDishBySetmealId(Long id);
}
